home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1991 …esperately Seeking Seven / Desperately Seeking Seven.2mg / Dev.CD.8 / Essentials / Tools / File.Type.Notes / FTN.50.5445 < prev    next >
Encoding:
Text File  |  1990-03-03  |  3.1 KB  |  72 lines  |  [04] ASCII Text (0x0000)

  1. Apple II
  2. File Type Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6. File Type:         $50 (80)
  7. Auxiliary Type:    $5445
  8.  
  9. Full Name:     Teach Document
  10. Short Name:    Teach document
  11.  
  12. Written by:    Matt Deatherage                                     March 1990
  13.  
  14. Files of this type and auxiliary type contain TextEdit-based documents.
  15. _____________________________________________________________________________
  16.  
  17. With the advent of TextEdit for the IIGS, many small text-editing applications 
  18. have suddenly appeared.  Apple may wish to release such a utility with the 
  19. System Software in the future, and has defined this simple file format for the 
  20. use of such a utility (referred to as "Teach" after the Macintosh program 
  21. "TeachText" by Bryan Stearns) and the use of any other text-editing program.
  22.  
  23. The file format is eminently suitable for a Text Edit record, and applications 
  24. should feel free to save any Text Edit record using this file format.  The 
  25. auxiliary type is the ASCII letters "TE".
  26.  
  27. The Data Fork
  28.  
  29. The data fork of a Teach document contains ASCII text.  All 256 characters are 
  30. allowed.  The data fork should not contain anything that shouldn't be 
  31. interpreted as ASCII text (for example, no data structures or pointers to 
  32. lines, etc.).
  33.  
  34. The Resource Fork
  35.  
  36. The resource fork of a Teach document contains two resources.  The first 
  37. resource is of type rStyleBlock ($8012) and has ID $00000001.  This resource 
  38. contains all the style information for the text contained in the data fork.  
  39. Each Teach document must contain this resource.  Programs that use Teach 
  40. documents may pass the resource ID $00000001 to TextEdit calls that require 
  41. TEFormat data structures, which is the data structure contained in an 
  42. rStyleBlock resource.  If this resource does not exist, passing the ID to 
  43. TextEdit could bring the system down.
  44.  
  45. The second resource is of type $7001 and has ID $00000001..This resource 
  46. contains window position information.  If the TextEdit record contains a ruler 
  47. which is tied to the window position (so the text rewraps when the window is 
  48. resized), when an application saves the record, it must include this resource.  
  49. In the same respect, if this resource exists in a Teach file, an application 
  50. must use this resource to set the window position and size.
  51.  
  52. Warning:  If an application fails to follow either of these steps, 
  53.           TextEdit may hang.
  54.  
  55. The format of this second resource is as follows:
  56.  
  57. Height     (+000)    Word    The window height in pixels.
  58. Width      (+002)    Word    The window width in pixels.
  59. Top        (+004)    Word    The y coordinate of the window's top.
  60. Left       (+006)    Word    The x coordinate of the window's left edge.
  61. Version    (+008)    Long    Version number.  Must be set to zero.
  62.  
  63. Other resources should not be placed in Teach documents.  Any program saving a 
  64. document could delete an older file with the same name instead of rewriting 
  65. it, causing any other resources to be lost.
  66.  
  67.  
  68. Further Reference
  69. _____________________________________________________________________________
  70.   o  Apple IIGS Toolbox Reference, Volume 3
  71.  
  72.